package com.jk.service.Impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jk.dao.ComboDao;
import com.jk.entity.ComboEntity;
import com.jk.service.ComboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ComboServiceimpl implements ComboService {

    @Autowired
    private ComboDao comboDao;

    @Override
    public List<ComboEntity> getlist(ComboEntity com) {
        QueryWrapper<ComboEntity> query = new QueryWrapper<>();
        query.like(com.getComboname() != null,"comboname",com.getComboname()); //调查
        return comboDao.selectList(query);
    }

    @Override
    public void delete(Integer id) {
        comboDao.deleteById(id);
    }

    @Override
    public void add(ComboEntity com) {
        comboDao.insert(com);
    }

    @Override
    public void update(ComboEntity com) {
        comboDao.updateById(com);
    }

}
